* ===============================================================================
* Treatment Effects; Table 4 + Table 5 + Table A4
* ===============================================================================
label var k_pol "Political Networks"
label var k_prime "Psychological Priming"
label var k_event "Contextual Priming"

* ===============================================================================
* Table 4 : Mean/SE of network size with baseline t-test using survey weights
* ===============================================================================
svy: mean n_size6 if year == 2016
svy: mean n_size6, over(k_imp), if year == 2016
svy: mean n_size6, over(k_prime), if year == 2016 & k_imp == 1 
svy: mean n_size6, over(k_prime), if year == 2016 & k_imp == 0
svy: mean n_size6, over(k_prime), if year == 2016
svy: mean n_size6, over(k_event), if year == 2016 & k_imp == 1 
svy: mean n_size6, over(k_event), if year == 2016 & k_imp == 0 
svy: mean n_size6, over(k_event), if year == 2016

svy: reg n_size6 k_prime if year == 2016 
svy: reg n_size6 k_prime if year == 2016 & k_imp == 1 
svy: reg n_size6 k_prime if year == 2016 & k_imp == 0
svy: reg n_size6 k_event if year == 2016
svy: reg n_size6 k_event if year == 2016 & k_imp == 1 
svy: reg n_size6 k_event if year == 2016 & k_imp == 0 

*------------------------------------------------------------------------------
* Table 5 : poisson models
*==============================================================================
global controls0 r_female r_age r_degree r_white r_black  r_married r_working r_hincome r_hsize r_metro 

estimates clear 
svy: poisson n_size6 k_pol k_prime k_event $controls0 if year == 2016
estimates store m1 
svy: poisson n_size6 k_prime k_event $controls0 if year == 2016 & k_imp == 1 
estimates store m2 
svy: poisson n_size6 k_prime k_event $controls0 if year == 2016 & k_imp == 0 
estimates store m3 
svy: poisson n_size6 c.k_prime##c.k_pol k_event $controls0 if year == 2016
estimates store m4 
svy: poisson n_size6 k_prime c.k_event##c.k_pol $controls0 if year == 2016
estimates store m5 

esttab * using "./tables/table_s1_tess2016_poisson.csv", csv replace star (+ 0.1 * 0.05 ** 0.01) se nogap label b(%9.2f) interaction(" X ") /*
*/ order(k_pol k_prime k_event c.k_prime#c.k_pol c.k_event#c.k_pol) mtitles("all" "important" "political" "all" "all")

*------------------------------------------------------------------------------
* Table A4 : negative binomial models
*==============================================================================
estimates clear 
svy: zip n_size k_pol k_prime k_event $controls0, inflate(k_pol k_prime k_event $controls0), if year == 2016
estimates store m1 
svy: zip n_size k_prime k_event $controls0, inflate( k_prime k_event $controls0), if year == 2016 & k_imp == 1 
estimates store m2 
svy: zip n_size k_prime k_event $controls0, inflate( k_prime k_event $controls0), if year == 2016 & k_imp == 0 
estimates store m3 
svy: zip n_size c.k_prime##c.k_pol k_event $controls0, inflate( c.k_prime##c.k_pol k_event $controls0), if year == 2016
estimates store m4 
svy: zip n_size k_prime c.k_event##c.k_pol $controls0, inflate( k_prime c.k_event##c.k_pol $controls0), if year == 2016
estimates store m5 

esttab * using "./tables/table_s1_tess2016_zip.csv", csv replace star (+ 0.1 * 0.05 ** 0.01) se nogap label b(%9.2f) interaction(" X ") /*
*/ order(k_pol k_prime k_event c.k_prime#c.k_pol c.k_event#c.k_pol) mtitles("all" "important" "political" "all" "all")

